<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li class="completed" v-for="item in arr" :key="item.id">
      <div class="view">
        <input class="toggle" type="checkbox" v-model="item.isDone" />
        <label>{{ item.name }} </label>
        <button class="destroy" @click="move(item.id)"></button>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  props: {
    arr: {
      type: Array,
      required: true,
    },
  },
  methods: {
    move(id) {
      this.$emit("move", id);
    },
  },
};
</script>
